package com.dongdongshop.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdong.pojo.TbAddress;
import com.dongdong.pojo.TbAddressExample;
import com.dongdong.service.AddressService;
import com.dongdongshop.mapper.TbAddressMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
@org.springframework.stereotype.Service
public class AddressServiceImpl implements AddressService {

    @Autowired
    private TbAddressMapper addressMapper;

    @Override
    public List<TbAddress>  selectByUserId(String username) {
        TbAddressExample example = new TbAddressExample();
        TbAddressExample.Criteria criteria = example.createCriteria();
        criteria.andUserIdEqualTo(username);
        List<TbAddress> tbAddresses = addressMapper.selectByExample(example);
        return tbAddresses;
    }
}
